package com.ltxtiyu.video.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.ltxtiyu.video.cacheDao.ConfigCacheDao;
import com.ltxtiyu.video.entity.Config;
import com.ltxtiyu.video.service.ms.ConfigrationService;
import org.springframework.beans.factory.annotation.Autowired;


@Service
public class ConfigrationServiceImpl implements ConfigrationService {
    @Autowired
    ConfigCacheDao configCacheDao;
    @Override
    public void addConfig(Config config) {
        configCacheDao.insertSelective(config);
    }

    /**
     * 根据key删除
     * @param ckey
     */
    @Override
    public void deleteConfig(String ckey) {
        configCacheDao.deleteByPrimaryKey(ckey);
    }

    @Override
    public void updateConfig(Config config) {
        configCacheDao.updateByCkey(config);
    }

    @Override
    public Config detailConfig(String ckey) {
        return configCacheDao.selectByCkey(ckey);
    }
}
